﻿using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;

namespace Songhay.Composition
{
    /// <summary>
    /// Static members for MEF Composition.
    /// </summary>
    public static partial class CompositionUtility
    {
        /// <summary>
        /// Gets the MEF composition container.
        /// </summary>
        /// <remarks>
        /// This member prevents making a reference
        /// to <see cref="System.ComponentModel.Composition.Hosting"/>
        /// in multiple places.
        /// </remarks>
        public static CompositionContainer GetCompositionContainer()
        {
            return new CompositionContainer();
        }

        /// <summary>
        /// Gets the MEF composition container
        /// with the specified catalog of exports.
        /// </summary>
        /// <param name="catalog">The catalog.</param>
        public static CompositionContainer GetCompositionContainer(ComposablePartCatalog catalog)
        {
            return new CompositionContainer(catalog);
        }
    }
}
